import React from 'react'
import {View,Text,Button} from 'react-native'
import FriendContainer from '../containers/FriendContainer'
import ChatContainer from '../containers/ChatContainer'
import Camera from '../pages/camera/camera'
import {
    createBottomTabNavigator,
    createStackNavigator,
    createDrawerNavigator
} from 'react-navigation';

/**
 * 消息
 */
class Msg extends React.Component{
    render(){
        return (
            <View>
                <Text>消息</Text>
            </View>
        )
    }
}



/**
 * 发现
 */
class Find extends React.Component{
    render(){
        return (
            <View>
                <Text>发现</Text>
            </View>
        )
    }
}

/**
 * 我
 */
class Me extends React.Component{
    render() {
        return (
            <View>
                <Text>我</Text>
            </View>
        );
    }
}

const FriendStackNagivation = createStackNavigator({
    Friend: FriendContainer,
    Chat:ChatContainer,
    Camera:Camera
})

FriendStackNagivation.navigationOptions = ({navigation}) => {
    let tabBarVisible = true
    if(navigation.state.index>0){
        tabBarVisible = false
    }
    return {
        tabBarVisible
    }
}

const HomeTab = createBottomTabNavigator({
    Msg:Msg,
    Friend:FriendStackNagivation,
    Find:Find,
    Me:Me
})

export default HomeTab
